package com.example.springboot.service;

import com.example.springboot.entity.Companies;
import com.example.springboot.mapper.EnterpriseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EnterpriseService {

    @Autowired
    private EnterpriseMapper enterpriseMapper;

    public List<Companies> findAll() {
        return enterpriseMapper.findAll();
    }

    public void addCompany(Companies company) {
        enterpriseMapper.addCompany(company);
    }

    public void editCompany(Companies company) {
        enterpriseMapper.editCompany(company);
    }

    public void deleteCompany(int company_id) {
        enterpriseMapper.deleteCompany(company_id);
    }

    public void deleteCompanyBatch(List<Long> ids) {
        enterpriseMapper.deleteCompanyBatch(ids);
    }

    public List<Companies> selectByName(String company_name) {
        return enterpriseMapper.selectByName(company_name);
    }
}